/*
 * Copyright (C) 2011-2012 Joachim Barthel
 *
 * $Id: oxads.js 114 2012-09-30 11:59:12Z jobarthel@gmail.com $
 *
 */

function showOxAds (actionID, styleSheet, bannerFormat, adMode)
{
    /* please adapt the URL according to your server where OXID is running */
    var serverURL = 'http://localhost/oxid/';

    var _app = navigator.appName;
    var _height;
    var _width;
    
    switch (bannerFormat) {
        case "SmallColumn":
            _height = 540;
            _width = 160;
            break;
            
        case "WideColumn":
            _height = 650;
            _width = 190;
            break;
            
        default:
            _height = 650;
            _width = 210;
            break;
    }
    
    if (_app == 'Microsoft Internet Explorer') {
        document.write('<iframe style="overflow:hidden;" frameborder="0" allowtransparency="true" id="oxads" height="'+_height+'" width="'+_width+'" src="'+serverURL+'modules/oxads/oxads.php?id='+actionID+'&s='+styleSheet+'&f='+bannerFormat+'&m='+adMode+'&h='+window.location.host+'"></iframe>');
        }
    else {
        document.write('<object style="overflow:hidden;" id="oxads" height="'+_height+'" width="'+_width+'" data="'+serverURL+'modules/oxads/oxads.php?id='+actionID+'&s='+styleSheet+'&f='+bannerFormat+'&m='+adMode+'&h='+window.location.host+'" type="text/plain"></object>');
    }
}